<?php

namespace App\Service;

use App\Entity\User;
use Doctrine\ORM\EntityManager;
use DI\Annotation\Inject;

class UserService
{

    /**
     * @Inject
     * @var EntityManager
     */
    private $em;

    public function login()
    {
        return 'login';
    }

    /**
     * @param int $id
     * @return User|mixed|object|null
     * @throws \Doctrine\ORM\ORMException
     * @throws \Doctrine\ORM\OptimisticLockException
     * @throws \Doctrine\ORM\TransactionRequiredException
     */
    public function gainDetail(int $id)
    {
        return $this->em->find(User::class, $id);
    }


}